import Vue from 'vue'
import Vuex from 'vuex'
import Persistedstate from 'vuex-persistedstate' //持久化vuex

import aside from './modules/aside.js'//导航栏
import user from './modules/user.js'//用户信息
import campus from "@/store/modules/campus.js"; //校区ID
Vue.use(Vuex)

const dataState = Persistedstate({
  //全部菜单
  paths: ['aside.menu','aside.openedTab','aside.isActive', 'user.username','user.email','campus.campusList','campus.buildingList'],
  storage: window.sessionStorage
})

export default new Vuex.Store({
  modules: {
    aside,
    user,
    campus
  },
  plugins: [dataState]
})
